home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / generic / compare.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  385 b   |  13 lines

  1. % compare.tex - macro to compare two strings
  2. % By \'Eamonn McManus.  This file is not copyrighted.
  3.  
  4. \def\compare#1#2{\compcont#1\ \\#2\ \\}
  5. \def\compcont#1#2\\#3#4\\{%
  6.      \csname comp%
  7.        \if #1#3\if #1\ same\else cont\fi
  8.        \else \ifnum `#1<`#3less\else greater\fi \fi
  9.      \endcsname #2\\#4\\}
  10. \def\compsame#1\\#2\\{0}
  11. \def\compless#1\\#2\\{-1}
  12. \def\compgreater#1\\#2\\{1}
  13.